#ifndef GTKMM_SDECODER_H
#define GTKMM_SDECODER_H

#include <gtkmm.h>
#include "F1TDC.hh"
#include "V792.hh"
#include "SIS3801.hh"
#include "VQWK.hh"


class SDecoder : public Gtk::Window
{

public:
  SDecoder();
  virtual ~SDecoder();

  short GetSelectedID(){return selected_RB_id;};
  void SetSelectedID(short id){ selected_RB_id =id;};
  void PrintLog(const std::string &log);


protected:

  //Signal handlers:

  void on_button_decode();
  void on_button_clear();
  void on_button_quit();
  void on_button_radio(int id);
  void on_my_insert_at_cursor(Glib::ustring str);

  //Child widgets:
  Gtk::VBox m_VBox;

  Gtk::HBox m_HBox_Entry;
  Gtk::Label m_Entry_Label;
  Gtk::Entry m_Entry;


  Gtk::Table m_Table;
  Gtk::RadioButton m_RButton[4];

  Gtk::ScrolledWindow m_ScrolledWindow;
  Gtk::TextView m_TextView;
  
  Glib::RefPtr<Gtk::TextBuffer> m_refTextBuffer;

  Gtk::HButtonBox m_ButtonBox;
  Gtk::Button m_Button_Quit;
  Gtk::Button m_Button_Decode;
  Gtk::Button m_Button_Clear;

  static const char* name[4];

 private:
  
  short selected_RB_id;
  F1TDC *f1tdc;
  V792  *v792qdc;
  SIS3801 *sis3801scaler;
  VQWK  *vqwkadc;

  void  ClearPointer();

};

#endif // GTKMM_SDECODER_H
